package com.ssy.lingxi.workflow.api.feign;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.workflow.api.model.vo.request.ProcessMemberRoleVO;
import com.ssy.lingxi.workflow.api.model.vo.request.ProcessRemoveMemberRoleVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.validation.Valid;

/**
 * （内部）流程步骤关联的会员自定义角色Feign接口
 * @author 万宁
 * @version 2.0.0
 * @date 2020-11-19
 */
@FeignClient(name = "workflow-service")
@RequestMapping("/workflow/role")
public interface ProcessMemberRoleControllerFeign {

    /**
     * 查询流程定义，关联流程步骤与会员自定义角色
     * <p>在新增、修改会员自定义角色的时候调用</p>
     * @param processMemberRoleVO 接口参数
     * @return 操作结果
     */
    @RequestMapping("/update")
    Wrapper<Void> updateInsertProcessAsync(@RequestBody @Valid ProcessMemberRoleVO processMemberRoleVO);

    /**
     * 从关联的流程步骤中，移除会员自定义角色
     * <p>在删除会员自定义角色的时候调用</p>
     * @param processRemoveMemberRoleVO 接口参数
     * @return 操作结果
     */
    @RequestMapping("/remove")
    Wrapper<Void> removeMemberRoleAsync(@RequestBody @Valid ProcessRemoveMemberRoleVO processRemoveMemberRoleVO);
}
